package com.self.smallma.myblogweb.web;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.self.smallma.myblogweb.entity.FriendEntity;
import com.self.smallma.myblogweb.service.FriendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @Description: 友链显示控制器
 * @Date: Created in 13:54 2020/4/16
 * @Author: ONESTAR
 * @QQ群: 530311074
 * @URL: https://onestar.newstar.net.cn/
 */
@Controller
public class FriendsShowController {

    @Autowired
    private FriendService friendService;

    @GetMapping("/friends")
    public String friends(Model model) {
        model.addAttribute("friendlinks",friendService.list(new QueryWrapper<FriendEntity>().orderByDesc("create_time")));
        return "friends";
    }



}